<?php
/**
 * BrandModel.php
 * Created by PhpStorm.
 * User: 江小波
 * Date: 2019/5/10
 * Time: 14:12
 */
namespace app\api\model;

use app\common\Singleton;
use think\Db;

class BrandModel
{
    use Singleton;

    public function getAll()
    {
        return Db::name('brand')
            ->where('is_enable',1)
            ->order('sort','asc')
            ->select();
    }

    public function getInfoById($id,$field="*")
    {
        return Db::name('brand')
            ->field($field)
            ->where('id',$id)
            ->find();
    }
}